<?php
namespace backend\models;

use Yii;
use yii\base\Model;
use yii\base\Exception;
use common\models\Employees;

class DepartureForm extends Model
{
	public $eid;

	public function formName()
    {
        return '';
    }

	public function rules()
	{
		return [
			['eid', 'required']
		];
	}

	public function departure()
	{
		$emp = Employees::findOne($this->eid);
		$emp->status = 0;
		if ($emp->save(false)) {
			return true;
		} else {
			return false;
		}
	}

}	